package com.zkt.practice.api.enums;

import lombok.Getter;

/**
 * @author 赵开泰
 * @program jc-club
 * @date 2024/10/6
 * @description 题目类型的枚举(1单选 2多选 3判断 4简答)
 **/

@Getter
public enum SubjectInfoTypeEnum {
	
	RADIO(1, "单选"),
	MULTIPLE(2, "多选"),
	JUDGE(3, "判断"),
	BRIEF(4, "简答");
	
	private final int code;
	private final String desc;
	
	SubjectInfoTypeEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static SubjectInfoTypeEnum getByCode(int codeVal) {
		for (SubjectInfoTypeEnum resultCodeEnum : SubjectInfoTypeEnum.values()) {
			if (resultCodeEnum.getCode() == codeVal) {
				return resultCodeEnum;
			}
		}
		return null;
	}
	
}